﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace My.Controllers
{
    [ApiController]
    [Route("api/[controller]/[action]")]
    public class LoginController : Controller
    {

       


       [HttpPost]
        public JsonResult Login([FromForm]Account login)//[FromBody]
        {
            HttpContext.Session.SetString("username","9999");
            return Json(new { code = 200, msg = "success" ,data=login.username+"-"+login.password});
        }
    }

    public class Account
    {
        public string username { get; set; }
        public string password { get; set; }
    }
}
